﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ApplyPathTemplateAction.CApApplyPathTemplateActionCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using System;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.ApplyPathTemplateAction;

public class CApApplyPathTemplateActionCmd : TxButtonCommand
{
  protected CApApplyPathTemplateActionEnabler m_enabler;
  private CUIApplyPathTemplateActionDlg m_form;

  public CApApplyPathTemplateActionCmd()
  {
    this.m_enabler = new CApApplyPathTemplateActionEnabler();
  }

  public virtual string Category => PathTemplateActionStringTable.CMD_CATEGORY;

  public virtual string Name => PathTemplateActionStringTable.CMD_NAME;

  public virtual string Tooltip => PathTemplateActionStringTable.CMD_TOOLTIP;

  public virtual string Bitmap => "ApplyPathTemplateAction.CUIApplyPathTemplate.bmp";

  public virtual string LargeBitmap => "ApplyPathTemplateAction.CUIApplyPathTemplate_LARGE.png";

  public virtual string Description => PathTemplateActionStringTable.CMD_DESCRIPTION;

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_enabler;

  public virtual bool Connect() => true;

  public virtual string[] AdvancedDescriptions => TxCallMessages.CollectMessages((ITxCommand) this);

  public virtual ITxImage Image => (ITxImage) TxImageManager.GetImageByKey("ApplyPathTemplate");

  public virtual void Execute(object cmdParams)
  {
    if (!TxCommandLicenser.ApplayPathTemplateActionLicense)
    {
      TxMessageBoxEx.ShowNoLicenseError(base.Name);
    }
    else
    {
      this.m_form = new CUIApplyPathTemplateActionDlg();
      if (cmdParams != null && cmdParams is Tuple<TxObjectList, string>)
      {
        Tuple<TxObjectList, string> tuple = cmdParams as Tuple<TxObjectList, string>;
        this.m_form.ExecuteAction(tuple.Item1, tuple.Item2);
      }
      else
        ((Control) this.m_form).Show();
    }
  }
}
